#include <stdio.h>
#include <string.h>

#define SIZE 1024
char buffer[SIZE];
int main(int argc,char* argv[])
{
  if(argc != 2)
  {
    printf("error!right command:./mycat filename\n");
    return 1;
  }
  
  FILE* fp = fopen(argv[1],"r");
  if(!fp)
  {
    perror("fopen");
    return 1;
  }
  while(!feof(fp))
    fread(buffer,1,sizeof(buffer) - 1,fp);
  printf("%s",buffer);
  return 0;
}
